from PyQt5.QtWidgets import QWidget
from gui import ui_Widget

class Tool1(QWidget):
    def __init__(self, variable_pool: dict):
        super().__init__()
        self.ui = ui_Widget.Ui_Form()
        self.ui.setupUi(self)

        self.ui.cal_btn.clicked.connect(self.cal_ret)
        self.variable_pool = variable_pool

    def cal_ret(self):
        d1 = self.ui.digit1.text()
        d2 = self.ui.digit2.text()
        ret = eval(f'{d1}+{d2}',self.variable_pool)
        self.ui.digit_ret.setText(str(ret))



